package org.main.bean.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.sql.ResultSet;
import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;


/**
 * 回复表
 */

@DynamicUpdate
@Entity
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "Hmessage")
public class Hmessage implements java.io.Serializable{
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private int id;
  @Column(name = "leaveId")
  private int leaveId;
  @Column(name = "merchantsId")
  private String merchantsId;
  @Column(name = "hLeavenr")
  private String hLeavenr;
  @Column(name = "hLeavesj" )
  private String hLeavesj;

  public String gethLeavesj() {
    Timestamp ts = Timestamp.valueOf(hLeavesj);
    Calendar c = Calendar.getInstance();
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日    hh时mm分ss秒");
    return sdf.format(c.getTime());
  }

  public void sethLeavesj(String hLeavesj) {
    this.hLeavesj = hLeavesj;
  }

  /*  public String gethLeavesj() {
    String time1=hLeavesj.replace(".0","");
    return time1;
  }

  public void sethLeavesj(String hLeavesj) {
    this.hLeavesj = hLeavesj;
  }*/
}
